package com.shilun.demo.demo.swagger.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author sl shilun217@qq.com
 * @Deacription
 * @date 2021/12/04/23:42
 **/
@Data
@ApiModel(description = "用户")
public class UserVo {
    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "姓名")
    @NotBlank(message = "姓名不能为空；")
    private String name;

    @ApiModelProperty(value = "地址")
    @NotBlank(message = "地址不能为空；")
    private String address;

    @ApiModelProperty(value = "手机号")
    @NotBlank(message = "手机号码不能为空；")
    @Pattern(regexp = "^0?(13|14|15|18)[0-9]{9}$", message = "手机号码不正确；")
    private String phone;

    @ApiModelProperty(value = "年龄")
    @NotNull(message = "年龄不能为空")
    private Integer age;
}
